Bug fixes.. started tests
Bug fixes