Fix sub errors