tweaked middle to ensure middle(x) and middle(x, x) have the same type (with tests)
Merge branch 'master' of https://github.com/JuliaLang/julia