Fixed several bugs which shall not be named