Fixed various bugs and added CONTAINER processing to pass all non-sample tests