Fixes on db script