Fixes error with custom session handlers