Fixed exceptions from previous slightly erroneous commit