Fixed DB schema

This pull fixed issue #555.
Thanks to @ofred