Few improvements and fixes, simple testing