More logging, fix silly bug with wrong return value