minor bug fixes in production mode