Bug fixes, added looger