ready to merge into dev, fixed bugs from pull req.