Fixed five bugs