General Code Cleanup and bin size fix for getPitch() method.