Integrating Didier's fixes...I choose his over mine before readdim2, though they are essentially the same