Improved Z=0 and Z=-1 compability

Fixed issue #11