Fixed multiple errors while using custom SDK to run SBT

Fixes http://devnet.jetbrains.com/message/5521874#5521874 and http://youtrack.jetbrains.com/issue/SCL-7481