Granularity fix

Fix some character encoding bugs and the granularity as part of the range function #11 #6