First stable version

Minor bug fixes and code clean up