bug fix and tidy

Signed-off-by: August Yip <augustyip@gmail.com>
Merge branch 'master' of https://github.com/augustyip/trade