Code cleanup

Also fixed the small mistake I did last time.