Cleaned up some minor bugs