Tweaked pgive and ptake
Tweaked, added console checking