Fixes for listings 5.12 and 5.13