more fixes to Denila's patch....