Fixes for bugs 23 and 24.