Properly handle nonetype