Don't try to get key unless the module built
Use switch instead of if statement to detect OS. Fixes bad check for OS.