bug fixes #10, 11 and 12 from SDK issues list