[31] Small fixes in the last commit

* This will allow correct database rebuilding