Some errors fixed

Thanks to Sisir in WPSE for his assistance fixing the errors