Improvements to efficiency and exception handling