Fixes for issues #339 and #334

The fix for #334 is very straightforward, but as for the one for #339, 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.