More bug fixes for whoosh script