Tweak to deal with nilclass error