Fixed all SQL injections and loops