Fixed numerous issues from cleanup