Make checks more efficient + Fix bug in session check