Fix #380 and Fix #358

Signed-off-by: Matt White <matthew.white@fclonline.com>