trailing hash characters should get trimmed