bug fixes for issues 271 and 272