Fixes various PHP notices from previous commit (sorry)