Better PIL checking