Fixed errors, cleaned templates, got rid of warnings.