Fix handling of error and kws.base_tmpl
Fix handling of error and kws.base_tmpl

Change-Id: I8d83f9976854847c4157c5711f43a90b6278aad0

apmasell/flabbergast,flabbergast-config/flabbergast,flabbergast-config/flabbergast,apmasell/flabbergast,apmasell/flabbergast,apmasell/flabbergast,flabbergast-config/flabbergast,apmasell/flabbergast,flabbergast-config/flabbergast,apmasell/flabbergast,flabbergast-config/flabbergast