Removed pointless tests for whether ctx was NULL or not.