Fixed horrible mistakes