Fixed misc php errors