Fixed the things that were not working properly

@shentonfreude Please review.