Bug fixes; Initial working fully