Cleaned up error handling to avoid passing unknown values to conversion functions
Added exception handling for compilation of functions