Fixed bug #13 and #14