Adding iOS 5.1 support. Not perfect, but works fine.