Improvements on trap interface and implementation.