Fixed FS#22 and FS#23