Source environment now longer needs to set when building

Now uses exceptions instead of asserts in unvalid but possible cases