fix null checks in output stream
update to .net 4.5 target