Fix uncaught errors