Yeah, that was something I thought, that it was some random RM2k3 stuff. At least the second was easy to "fix", as it was just having one extra empty terrain.
The first bug it's kind of messy and haven't figured out what caused it. BUT, seems to work fine now!
By now my only advice is that, whenever you're toying around with database stuff, make sure there is always an empty item at the end of each array. Like an empty tileset, an empty terrain... etc. Seems to help plugins to know where each database section ends.