Cleaned some useless code and fixed #5.