Restored code which was lost by my fault, sigh.