Fixes for caps and error handling