Fixes compilation issues.

Does some funky things to the .dme, but this replaces the missing sql file as well as fixes compilation errors.