Fixed some bugs, improved overall reliability.