Fix all the stuff. Add @A-J-C's changes