Fixed error cases