Fixes for issues #399 and #334

The fix for #334 is very straightforward, but as for the one for #399, I don't really understand why that piece of code was added there, unless it was under the wrong assumption that SDK version and OS version should always match for the simulator.