fix capfile bugs, change database settings for production