Bug fixes and further hash implementation