entrust bug fix. and cleanup