fixed some 1.9isms, works on 1.8
add 1.8.7 to travis build