Fix bugs in production