Yes I looked at the code and the ifs are going to cause a lot of issues right now.  I filled issue #5 for a fix to this.  If you want to try and fix it as part of this pull that is fine.