Some fixes

Hi!
I've make some improoves to Npgsql.

First and second commits are universal and works good.

Third may break backward compatibility. But it's correct for actual versions of PostgreSQL. If you make me advice how to do this more correct I can rewrite my code.