Build 3: Fixed some error handling issues