Fix if statements for form checking and post variable checking