Repaired some anoying bugs.