Fixed warnings & removed useless checking