More error handling and better dependency support