Fixing issue #139 where query parameter was mistaken for server port.
Improved generics support.