Fixed some exceptions, trying to stabilize this