Changed error handling in modules