Add exception handlers and deletion of useless use-flags