Bug fixes for #121 and #122

I really doubt #122 is an issue after looking at it but no easy way to suppress the uninitialized pointer warning.