bin to dec conversion bugfix