Bug fixes after first tests