Fix bugs reported by Mike about the build process and generation of database annotation in default package.