Fixed issue when query parameter may not have a value

See #287