Fix the AttributeError that sometimes would occur at breakpoints. Fix #57, #54.