Fixes for the new portable class library support

This includes a fix for the issue brought up by @cdrnet in #380.