bug fixes and further dev