Few bug fixes and additions
Test code still present