port fixes from https://github.com/raintank/tsdb-gw/pull/67
port fixes from https://github.com/raintank/tsdb-gw/pull/67

replay/metrictank,replay/metrictank,raintank/raintank-metric,raintank/metrictank,raintank/metrictank,raintank/metrictank,replay/metrictank,raintank/raintank-metric,raintank/metrictank,replay/metrictank,raintank/raintank-metric