Improved nested checks for #127.